package cn.gson.crm.controller.total;


import java.util.ArrayList;
import java.util.List;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.gson.crm.controller.BaseServlet;
import cn.gson.crm.model.dao.EmploDao;
import cn.gson.crm.model.dao.TotalDao;
import cn.gson.crm.model.entity.Employee;

/**
 *	数据统计
 */
@WebServlet("/student/total")
public class DataTotal extends BaseServlet {
	private static final long serialVersionUID = 1L;
	private TotalDao toDao = new TotalDao();
	private EmploDao empDao = new EmploDao();
	
	@Override
	protected void get(HttpServletRequest request, HttpServletResponse response) throws Exception {
		super.get(request, response);
		 Employee emp1 = empDao.emploGetById("正常",1);
		 Employee emp2 = empDao.emploGetById("正常",2);
		 Employee emp3 = empDao.emploGetById("正常",3);
		 Employee emp4 = empDao.emploGetById("正常",4);
		 Employee emp5 = empDao.emploGetById("正常",5);
		 Employee emp6 = empDao.emploGetById("正常",6);
		 Integer noTotal1 = toDao.getEmpAllocationTotal1(1);
		 Integer noTotal2 = toDao.getEmpAllocationTotal1(2);
		 Integer noTotal3 = toDao.getEmpAllocationTotal1(3);
		 Integer noTotal4 = toDao.getEmpAllocationTotal1(4);
		 Integer noTotal5 = toDao.getEmpAllocationTotal1(5);
		 Integer noTotal6 = toDao.getEmpAllocationTotal1(6);
		 
		 Integer total1 = toDao.getEmpAllocationTotal2(1);
		 Integer total2 = toDao.getEmpAllocationTotal2(2);
		 Integer total3 = toDao.getEmpAllocationTotal2(3);
		 Integer total4 = toDao.getEmpAllocationTotal2(4);
		 Integer total5 = toDao.getEmpAllocationTotal2(5);
		 Integer total6 = toDao.getEmpAllocationTotal2(6);
		 
		 request.setAttribute("emp1", emp1);
		 request.setAttribute("emp2", emp2);
		 request.setAttribute("emp3", emp3);
		 request.setAttribute("emp4", emp4);
		 request.setAttribute("emp5", emp5);
		 request.setAttribute("emp6", emp6);
		 request.setAttribute("noTotal1", noTotal1);
		 request.setAttribute("noTotal2", noTotal2);
		 request.setAttribute("noTotal3", noTotal3);
		 request.setAttribute("noTotal4", noTotal4);
		 request.setAttribute("noTotal5", noTotal5);
		 request.setAttribute("noTotal6", noTotal6);
		 request.setAttribute("total1", total1);
		 request.setAttribute("total2", total2);
		 request.setAttribute("total3", total3);
		 request.setAttribute("total4", total4);
		 request.setAttribute("total5", total5);
		 request.setAttribute("total6", total6);
		 
		 forward("total/data_total.jsp");
	}
}
